/**
 * 
 */
package com.cnhaimei.com;

import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.widget.ListView;

/**
 * 
 * 放置于DragView里的控件
 * 
 * @author Jin.Wu
 * 
 */
public class DragListView extends ListView {

	DragView mDragView;
	
	/**
	 * @return the mDragView
	 */
	public DragView getDragView() {
		return mDragView;
	}

	/**
	 * @param mDragView the mDragView to set
	 */
	public void setDragView(DragView mDragView) {
		this.mDragView = mDragView;
	}

	public DragListView(Context context, AttributeSet attrs, int defStyle) {
		super(context, attrs, defStyle);
	}

	public DragListView(Context context, AttributeSet attrs) {
		super(context, attrs);
	}

	public DragListView(Context context) {
		super(context);
	}
	
	

	@Override
	public boolean onInterceptTouchEvent(MotionEvent ev) {
		if (mDragView != null && mDragView.isDragging()) {
			return false;
		}

		return super.onInterceptTouchEvent(ev);
	}

	@Override
	public boolean onTouchEvent(MotionEvent ev) {
		if (mDragView != null && mDragView.isDragging()) {
			return false;
		}

		return super.onTouchEvent(ev);
	}

}
